#ifndef BOARD_WIDGET_H
#define BOARD_WIDGET_H

#include <QWidget>
#include <QPainter>
#include <QMouseEvent>
#include <QTimer>


#include "minimax.h"

#include "game_engine.h"

namespace Ui {
    class BoardWidget;
}

class BoardWidget : public QWidget
{
    Q_OBJECT

public:
    explicit BoardWidget(GameEngine *reversi_game, QWidget *parent = 0);
    ~BoardWidget();
protected:
    void paintEvent(QPaintEvent *);
    void mousePressEvent(QMouseEvent *);
    void resize(int w, int h);
public slots:
    void cpu_play();
private:
    void draw_grid();
    void draw_white_board();
    void draw_black_board();
    void draw_available_moves();
    void draw_scores();

    Minimax *minimax;
    QTimer m_timer;

    int m_block_size;
    int m_x_selected;
    int m_y_selected;
    int m_width;
    int m_height;
    GameEngine *m_curr_game;
    QPainter m_painter;
    Ui::BoardWidget *ui;
};

#endif // BOARD_WIDGET_H
